<?php
/**
 * Created by PhpStorm.
 * User: Wang Zhaogang
 * Date: 2015/12/11
 * Time: 10:29
 */

$params = require(__DIR__ . '/params.php');

$config = [
    'id' => 'admin',
    'defaultRoute' => 'test/index',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'components' => [
        'request' => [
            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
            'cookieValidationKey' => 'Baba1234Rpc',
        ],
        'urlManager' => array(
            'showScriptName' => false,
            'enablePrettyUrl' => true,
        ),
        'log' => [
            'traceLevel' => 10,//YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning', 'info', 'trace'],
                    'maxFileSize' => 1024 * 2,
                    'maxLogFiles' => 20,
                    'logVars' => [],
                    'except'=>['yii\db\*', 'yii\web\*'],
                ],
            ],
        ],
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'db' => require(__DIR__ . '/db.php'),
    ],
    'params' => $params,
];

if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    //$config['bootstrap'][] = 'debug';
    //$config['modules']['debug'] = [
    //    'class' => 'yii\debug\Module',
    //];

    //$config['bootstrap'][] = 'gii';
    //$config['modules']['gii'] = [
    //    'class' => 'yii\gii\Module',
    //    'allowedIPs' => ['*.*.*.*'],
    //];
}

return $config;
